package com.jiyun.model;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Data;
import lombok.ToString;

import java.util.List;

/* *
 * @Author nxj
 * @Date 2023 08 2023/8/4 19 49
 * */

@Data
@ToString
public class Catalog {
    @TableId(value = "id",type = IdType.AUTO)
    private Integer id;
    private String cname;
    private Integer status;
    private Integer pid;
    @TableField(exist = false)
    @JsonInclude(value = JsonInclude.Include.NON_EMPTY)
    public List<Catalog>children;

    @TableField(exist = false)
    public String state;

    public Catalog() {
    }

    public Catalog(Integer id, String cname, Integer status, Integer pid) {
        this.id = id;
        this.cname = cname;
        this.status = status;
        this.pid = pid;
    }
}
